package com.yf1706.service;


import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yf1706.bean.CheckHolidayKind;
import com.yf1706.bean.RecApplyRecord;
import com.yf1706.dao.jpa.IRecAppplyRecordJDAO;
import com.yf1706.dao.mybatis.IRecApplyRecordMDAO;

@Service
//rollbackFor回滚，因为service对多个dao层操作，当有一个SQL错了就把所有语句多返回
@Transactional(rollbackFor=Exception.class)
//service的作用是对业务逻辑(dao)进行封装，对外(controller)提供业务逻辑调用。所以这里要调用dao层的类
public class RecApplyRecordService {
	@Autowired
	private IRecApplyRecordMDAO rarmdao;
	@Autowired
	private IRecAppplyRecordJDAO rarjdao;
	
	
	
	public List<RecApplyRecord> queryAllRecApplyRecord(){
		return rarmdao.queryAllRecApplyRecord();
	}
	
	/*public List<RecApplyRecord> queryBySearch(String sort,String order,String searchValue){
		return rarmdao.queryBySearch(sort,order,searchValue);
	}*/
	
	//根据招聘申请编号获取招聘申请对象
	public RecApplyRecord queryById(int recordId) {
		return rarmdao.queryById(recordId);
	}
	
	//一、新增方法
	public void addRecApplyRecord(RecApplyRecord rar) {
		rarjdao.save(rar);
	}
	
	//二、删除方法
	public void deleteRecApplyRecord(int id) {
		rarjdao.deleteById(id);;
	}
	
	//三、修改方法
	public void updateRecApplyRecord(RecApplyRecord rar) {
		rarjdao.save(rar);
	}
	
	//四、模糊查询招聘申请单信息
	public List<RecApplyRecord> getSearchRecApplyRecordList(String rarname){
		return rarmdao.querySearchRecApplyRecord(rarname);
	}
	
}
